package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ItemHistory generated by hbm2java
 */
@Entity
@Table(name = "item_history")
public class ItemHistory implements java.io.Serializable {

	private Long itemHistoryId;
	private Item item;
	private Date itemIncludeDate;
	private Double itemTotalPrice;

	public ItemHistory() {
	}

	public ItemHistory(Item item, Date itemIncludeDate) {
		this.item = item;
		this.itemIncludeDate = itemIncludeDate;
	}

	public ItemHistory(Item item, Date itemIncludeDate, Double itemTotalPrice) {
		this.item = item;
		this.itemIncludeDate = itemIncludeDate;
		this.itemTotalPrice = itemTotalPrice;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ITEM_HISTORY_ID", unique = true, nullable = false)
	public Long getItemHistoryId() {
		return this.itemHistoryId;
	}

	public void setItemHistoryId(Long itemHistoryId) {
		this.itemHistoryId = itemHistoryId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ITEM_ID", nullable = false)
	public Item getItem() {
		return this.item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ITEM_INCLUDE_DATE", nullable = false, length = 19)
	public Date getItemIncludeDate() {
		return this.itemIncludeDate;
	}

	public void setItemIncludeDate(Date itemIncludeDate) {
		this.itemIncludeDate = itemIncludeDate;
	}

	@Column(name = "ITEM_TOTAL_PRICE", precision = 22, scale = 0)
	public Double getItemTotalPrice() {
		return this.itemTotalPrice;
	}

	public void setItemTotalPrice(Double itemTotalPrice) {
		this.itemTotalPrice = itemTotalPrice;
	}

}
